/**
 * 
 */
package com.demo2do.dubbo.api.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.demo2do.core.persistence.GenericJdbcSupport;
import com.demo2do.dubbo.protocol.entity.ProductCategory;
import com.demo2do.dubbo.protocol.service.DemoService;

/**
 * @author lute
 *
 */
public class DemoServiceImpl implements DemoService {

    @Autowired
    private GenericJdbcSupport genericJdbcSupport;

    /* (non-Javadoc)
     * @see com.demo2do.dubbo.protocol.DemoService#sayHello(java.lang.String)
     */
    public String sayHello(String name) {
        return "Hello " + name;
    }

    /* (non-Javadoc)
     * @see com.demo2do.dubbo.protocol.service.DemoService#createProductCategory(com.demo2do.dubbo.protocol.entity.ProductCategory)
     */
    public void createProductCategory(ProductCategory productCategory) {
        String sentence = "INSERT INTO product_category(product_no, service_month, description) VALUES (:productNo, :serviceMonth, :description)";
        genericJdbcSupport.executeSQL(sentence, productCategory);
    }

}
